-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v3 without conan #496
Merged
Merged
v3 without conan #496
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added a possible test folder structure. Added an empty test/ql/ir/cqasm/read.cc test file.
read.cc: moved parse code to a separate function, which is the one that is being tested.
- renamed 'read' as read_v1 and added read_v3. src/ql/ir/cqasm/read.cc: - 'read' now parses the program version and calls whether read_v1 or read_v3. - read_v3 still doesn't do anything. test/ql/ir/cqasm/read.cc: - commented out tests for versions older than 1.2 as they need an IR with just more than a 'version' statement. - tests now create an IR and a basic platform and call 'read', passing a very simple program that only has a 'version' statement.
… being PlatformFake. Now the test is simplified a bit.
Added OpenQL/v3 to GitHub Actions.
This change makes some of the git submodules to stop working, since they are not C++20 compliant. That doesn't mean we can not still use their binaries. Updated GitHub workflow's cpp job to use Conan. Updated README file. .gitmodules, CMakeLists.txt, conanfile.py: - Removed all git submodules. - Added backward-cpp, cimg, eigen, highs, nlohmann_json, doctest and gtest as Conan dependencies. - libqasm and lemon are now obtained via FetchContent, since there are not yet Conan packages for them. - lemon is patched after download to fix C++17 and C++20 compilation warnings. circuit.h/cc, functions.h/cc, gate.h, list.h, mappings.h, old_to_new.cc, past.cc, prim.h, types.h, unitary.cc, vec.h: fixed C++20 compilation warnings and errors.
TODO: organize tests in OpenQL as we did for libqasm. Updated setup.py so that it calls Conan instead of CMake. Added a new patch for lemon. Removed highs from .gitmodules.
… anyway, and 2) and most importantly, since libqasm is fetched via FetchContent, it will require flex/bison/m4/tree-gen for its compilation. conanfile.py: added flex/bison/m4 as dependencies to conanfile.py. test.yml: commented out everything except for C++ Windows builds.
C++20 adds a 'synthesized' y==x for each x==y, what can lead to ambiguities in existing C++17 code. In our case, many of these operator== implementations come from code generated by tree-gen. A possible solution would be to add friend operator== functions to resolve the ambiguities. A probably less elegant solution, that is what I've done here, and that avoids touching the code generated by tree-gen, is to use the x.operator==(y) syntax in the caller side.
I've finally added a non-member operator==(const Object &, const PhysicalObject &) to resolve the code ambiguities due to moving to C++20: - We leave all the existing code untouched, and using the simpler syntax 'x == y' instead of 'x.operator==(y)'. - We don't change anything either in ir.tree (e.g. adding the non-member function there as a friend to PhysicalObject, for example). - We simply add the function in 'ir_gen_ex.cc' (read it as an extension to ir.gen.cc, the file generated by tree-gen).
test.yml: going to test only macos for the moment.
Testing C++23 Ubuntu/MacOS/Windows compilation.
…rator==(const Object&, const PhysicalObject&).
…rator==(const Link<Object>&, const Link<PhysicalObjec>t&).
…perator==(const Link<Object>&, const Link<PhysicalObjec>t&).
CMakeLists.txt: added a debug comment to the patch_lemon_sources_command. test.yml: testing only MacOS.
…h after the copy.
- Temporarily commented out 'add_subdirectory(test)'. - Minor aesthetic changes to the FetchContent sections. test.yml: - Removed OPENQL_BUILD_CPP_STANDALONE_EXAMPLE option, and 'example' execution from all the jbs. - Changed '$env::GITHUB_ENV' to '$GITHUB_ENV' for Python Windows builds.
CMakeLists.txt: - 'add_subdirectory(test)' commented in again. test.yml: - Changed number of parallel build processes from 10 to 5. - Changed '$GITHUB_ENV' back to '$env:GIHTUB_ENV' for Python Windows builds.
- All tests are now under the 'test' folder. - All tests are googletest. doctest dependency has been removed. - All tests are discovered. CMake code for adding tests has been removed. - Python tests have been updated to comply to most of PEP 8 (code style guide). Reorganized resources. - All resources are now under the 'res' folder. Reorganized examples. - All example codes are now under 'example' folders within 'test'. - All example resources are now under 'example' folders within 'res'. The structure of the 'test' folder is: |- ql | \- com, ir, pass, utils... |- v1x | |- cpp | | \- example | |- python | |- example | \- visualizer The structure of the 'res/v1x' folder is: |- cq | |- example | \- golden |- json | \- visualizer |- qasm \- golden 'v1x' stands for cQasm v1.x. There may be folders such as 'v3x' in the future.
…t_conan # Conflicts: # CMakeLists.txt
…cludes all the libqasm/v3 work. Updated v1 references to v1x.
…lop' prior to the pull request. [skip ci]
# Conflicts: # .github/workflows/test.yml # include/ql/ir/compat/gate.h # res/v1x/json/debug.cc # res/v1x/json/test_cfg_none_simple.json # res/v1x/json/test_multi_core_64x16_full.json # res/v1x/json/test_unitary.cc # res/v1x/qasm/golden/test_condex_toffoli_compos_gate_last.qasm # res/v1x/qasm/golden/test_mc_non_comms_last.qasm # res/v1x/qasm/test_gate_decomposition_cz.cc_backend.map # res/v1x/qasm/test_gate_decomposition_cz.cc_backend.vcd # res/v1x/qasm/test_gate_decomposition_cz.cc_backend.vq1asm # res/v1x/qasm/test_gate_decomposition_cz.initial.cq # res/v1x/qasm/test_gate_decomposition_cz.scheduled.cq # res/v1x/qasm/test_qi_example.cc_backend.map # res/v1x/qasm/test_qi_example.cc_backend.vcd # res/v1x/qasm/test_qi_example.cc_backend.vq1asm # res/v1x/qasm/test_qi_example.initial.cq # res/v1x/qasm/test_qi_example.scheduled.cq # src/ql/arch/cc/pass/gen/vq1asm/detail/backend.cc # src/ql/arch/cc/pass/gen/vq1asm/detail/functions.cc # src/ql/ir/new_to_old.cc # src/ql/pass/ana/visualize/detail/types.h # src/ql/pass/map/qubits/map/detail/alter.cc # src/ql/pass/map/qubits/map/detail/free_cycle.cc # src/ql/pass/map/qubits/map/detail/mapper.cc # src/ql/pass/map/qubits/map/detail/past.cc # src/ql/pass/map/qubits/place_mip/place_mip.cc # tests/CMakeLists.txt # tests/test_mapper.py # tests/test_unitary.py
README.md: removed Dependencies and Installation sections (reverted PR changes). include/ql/ir/cqasm: removed '#include "cqasm.hpp"', and 'read_v3' function declaration. test.yml: added 'on/push/pull_request'. tests: removed.
… 'write_model_to_file' to true by default. The IpGridTest.grid__find_complex_permutation ends up calling Impl::run and writing an 'LpMatrix.pbm' file to the root directory. We have changed it to write the file to the temporary directory instead. Another option would be not to write out any file during testing.
…l.h sets 'write_model_to_file' to true by default." This reverts commit 23f2d1c.
Renaming of some resource files.
pablolh
reviewed
Aug 10, 2023
few comments I think this can be merged quickly! |
test.yml: removed 'fetch-depth: 0' and moved 'checkout' stop after installation steps and right before creation of the build directory. assets.yml: - Updated 'checkout' step to not use 'recursive'. - Updated GitHub Actions versions. - Changed manylinux job's 'Install cmake' step to use 'Get latest CMake', as in other jobs. - Removed dependency to Python 3.7. - Removed commented code. src/*.cc: added back in the names of the unused parameters, although commmented out. cpp_standalone.cc: changed into a test.
pablolh
approved these changes
Aug 16, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CMake
Updated C++ version to C++23.
Updated GitHub Actions to build in gcc/clang/msvc x Linux/MacOS/Windows x Debug/Release.
Updated dependency management to be done through FetchContent instead of git submodules.
Reorganized tests, examples, and resources.
Reorganized tests.
test
folder.googletest
.doctest
dependency has been removed.Reorganized resources.
res
folder.Reorganized examples.
example
folders withintest
.example
folders withinres
.The structure of the
test
folder is:The structure of the
res/v1x
folder is:v1x
stands for cQasm v1.x. There may be folders such asv3x
in the future.File changes
from openql import openql as ql
toimport openql as ql
.nqubits
tonum_qubits
.res
.ql
target_compile_options.test/v1x/python
.